home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / initcl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-28  |  1.5 KB  |  79 lines

  1. /* ---------------------------------------------- */
  2. /* BCC header. Inserted into every generated file */
  3. /* ---------------------------------------------- */
  4.  
  5. #ifndef _BCC_EVERY
  6. #define _BCC_EVERY
  7.  
  8. /* Includes necessary for every mui c code */
  9.  
  10. #include <proto/exec.h>
  11. #include <proto/muimaster.h>
  12. #include <libraries/mui.h>
  13.  
  14. #include <mui/muiextra.h>
  15.  
  16. #include <string.h>
  17.  
  18. /* defines that help adjusting to any compiler */
  19.  
  20. #ifdef _DCC
  21.     #define REG(x) __ ## x
  22.     #define ASM
  23.     #define SAVEDS __geta4
  24. #else
  25.     #define REG(x) register __ ## x
  26.  
  27.     #ifdef _STORM
  28.  
  29.             #define ASM
  30.             #define SAVEDS __saveds
  31.  
  32.     #else
  33.  
  34.         #if defined __MAXON__ || defined __GNUC__
  35.             #define ASM
  36.             #define SAVEDS
  37.         #else
  38.             #define ASM    __asm
  39.             #define SAVEDS __saveds
  40.         #endif
  41.     
  42.     #endif
  43.  
  44. #endif
  45.  
  46. #define CallSuper() DoSuperMethodA(cl, obj, msg)
  47. #define value (tag->ti_Data)
  48. #define GetData() INST_DATA(cl, obj)
  49.  
  50. #endif
  51. struct MUI_CustomClass *MyApplication_Create( void );
  52. struct MUI_CustomClass *MyClass_Create( void );
  53. struct MUI_CustomClass *MyWindow_Create( void );
  54.  
  55. #include "initcl.h"
  56.  
  57. struct MUI_CustomClass *cl_MyApplication;
  58. struct MUI_CustomClass *cl_MyClass;
  59. struct MUI_CustomClass *cl_MyWindow;
  60.  
  61. short _initclasses( void )
  62. {
  63.     if( !(cl_MyApplication = MyApplication_Create()) ) goto error;
  64.     if( !(cl_MyClass = MyClass_Create()) ) goto error;
  65.     if( !(cl_MyWindow = MyWindow_Create()) ) goto error;
  66.  
  67.     return 1;
  68.  error:
  69.     _freeclasses();
  70.     return 0;
  71. }
  72.  
  73. void _freeclasses( void )
  74. {
  75.     MUI_DeleteCustomClass( cl_MyApplication );
  76.     MUI_DeleteCustomClass( cl_MyClass );
  77.     MUI_DeleteCustomClass( cl_MyWindow );
  78. }
  79.